﻿using System.Globalization;

namespace CSharpPro._0928;

public class Demo
{
    //作业1
    public  bool Isshuixianhuashu(int num)
   {
      int hundreds=num/100;
      int tens=num/10%10;
      int ones=num%10;
      double cubenum=Math.Pow(hundreds,3)+Math.Pow(tens,3)+Math.Pow(ones,3);
      return cubenum==num;
   }
    //作业2
    public bool IsPrime(int num)
    {
        if (num < 2)
        {
            return false;
        }
        for (int i = 2; i <=Math.Sqrt(num); i++)
        {
            if (num % i == 0)
            {
                return false;
            }
        }
        return true;
    }
}